<%@ page import="myschool.service.GradeService" %>
<%@ page import="myschool.entity.Grade" %>
<%@ page import="java.util.List" %>
<%-- Created by IntelliJ IDEA.
  User: admin
  Date: 2022/7/1
  Time: 15:31
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>2：通过表单添加新科目(注意年级的处理)</title>
</head>
<body>
<form action="doaddsubject.jsp">
    <p>课程名称<input type="text" name="sbname" placeholder="请输入课程名称" required></p>
    <p>学习课时<input type="number" name="sbhour" placeholder="请输入学习课时" required></p>
    <p>年级编号<select name="sbgid"><%
        List<Grade> grades = GradeService.ME.findALL();
        for (Grade g : grades) {
    %>
        <option  value="<%=g.getId()%>"><%=g.getName()%>
        </option>
        <%}%>
    </select></p>
    <p><input id="bt" type="submit" value="新增"
              style="border:none; background: skyblue;color: white;width: 199px;height: 50px"></p>
</form>
</body>
</html>
